public class People {
	String fName;
	String lName;
	String name;
	String mood;
	int age;
	int carsOwned;
	Car myCars1[] = new Car[2];
	String myCars[] = new String[2];
	
	public People(){
		name = "No Name";
		mood = "Sleeping";
		age = 0;
		carsOwned = 0;
	}
	
	public People(String fName, String lName, String mood, int age){
		this.fName = fName;
		this.lName = lName;
		this.name = fName + " " + lName;
		this.mood = mood;
		this.age = age;
		carsOwned = 0;
	}
	
	public String getName(){
		return this.name;
	}
	
	public String getMood(){
		return this.mood;
	}
	
	public int getAge(){
		return this.age;
	}
	
	public int getNumberOfCars(){
		return this.carsOwned;
	}
	
	public boolean buyNewCar(Car c1){
		if (c1.isNew == true && c1.owner == "None" && this.carsOwned < 2){
			c1.buyNew(this);
			myCars[carsOwned] = c1.model;
			carsOwned++;
			return true;
		}
		else{return false;}
	}
	
	public boolean buyUsedCar(Car c1, People p1){
		if (c1.owner == p1.name && this.carsOwned < 2){
			c1.buyUsed(this);
			myCars[carsOwned] = c1.model;
			carsOwned++;
			p1.carsOwned--;
			p1.myCars[p1.carsOwned]=null;
			return true;
		}
		else{return false;}
	}
	
	public boolean sellCar(Car c1){
		if (c1.owner == this.name){
			c1.owner = "None";
			this.carsOwned--;
			return true;
		}
		else{return false;}
	}
	
	public String showPerson(){
		String personInfo = fName+"/"+lName+"/"+mood+"/"+age+"/"+carsOwned+"/"+myCars[0]+"/"+myCars[1];
		return personInfo;
	}
}
